package com.TheyChat.service.config.core.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.TheyChat.service.config.core.enums.StatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Author: victor.w.ye
 * @Date: 2021/2/20 13:50
 * @Copyright:
 * @Company: luban
 * @Version: 1.0.0
 **/
@Data
public abstract class BaseEntity implements Serializable {
    /***
     * ID主键
     */
    @ApiModelProperty(value = "ID主键")
    @TableId(type = IdType.ASSIGN_UUID)
//    @TableId
    private String id;

    /***
     * 是否删除
     */
    @ApiModelProperty(value = "数据状态(1=有效，0=无效,-1=已删除")
    @TableField(fill = FieldFill.INSERT)
    private StatusEnum status;
    /***
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    private String createUser;
    /***
     * 编辑人
     */
    @ApiModelProperty(value = "编辑人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String editUser;
    /***
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    /***
     * 编辑时间
     */
    @ApiModelProperty(value = "编辑时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime editTime;

}
